import requests
from BiliBili_av2bv import dec

def parse_home_page(bv):
    video_api = 'https://api.bilibili.com/x/web-interface/archive/stat'

    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'}

    aid = dec(bv)
    params = {'aid': aid}

    response = requests.get(url=video_api, params=params,headers=headers)

    video_data = eval(response.text)["data"]

    print(video_data)



if __name__ == '__main__':
    bv = input('B站bv号（带上BV）') #BV1or4y1A7ZS
    video_info = parse_home_page(bv)


